package com.pan.behavioral.chain.node.shape;

import com.pan.behavioral.chain.node.ChainNode;

import java.awt.*;


/**
 *
 *
 *
 */

public abstract class ShapeNode extends ChainNode<Graphics> {




    public ShapeNode(ChainNode nextNode) {
        super(nextNode);
    }

    @Override
    public void response(Graphics obj) {
        super.response(obj);
        handle(obj);
        if (nextNode != null){
            nextNode.response(obj);
        }
    }

    @Override
    public boolean isProcessable(Graphics obj) {
        return true;
    }


    public abstract void handle(Graphics obj);
}
